/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package woowcrawler;

import ptstemmer.*;
import ptstemmer.implementations.OrengoStemmer;

/**
 *
 * @author Heitor
 */
public class WooWStemmer
{

    public String getRadical(String s)
    {
        String temp = "";

        try
        {
            Stemmer st = new OrengoStemmer();

            temp = st.getWordStem(s);
        }
        catch (Exception x)
        {
            System.out.println("FAIL");
        }

        return temp;
    }

    public String[] getRadicais(String[] array)
    {
        String[] temp = new String[array.length];

        try
        {
            int i = 0;
            for (String s : array)
            {
                Stemmer st = new OrengoStemmer();

                temp[i] = st.getWordStem(s);
                i++;
            }
        }
        catch (Exception x)
        {
            System.out.println("FAIL");
        }

        return temp;
    }
}
